<?php
/**
* 店铺服务
*/
class JddjStoreSvc extends JddjCommon
{
    
    /** 新增无资质门店接口
     * @param $stationName 门店名称
     * @param $phone 门店电话
     * @param $city 城市编码
     * @param $county 镇/区编码
     * @param $stationAddress 门店地址
     * @param $operator 操作人
     * @param $serviceTimeStart1 营业时间1开始
     * @param $serviceTimeEnd1 营业时间1结束
     * @param $lat 门店纬度
     * @param $lng 门店经度
     * @param $coordinateType 使用的地图类型(1,谷歌), (2,百度), (3,高德), (4,腾讯)
     * @param $closeStatus 休息中状态，0正常营业1休息中
     * @param $storeNotice 门店公告
     */
    public function createStore($stationName, $phone, $city, $county, $stationAddress, $operator, $serviceTimeStart1, $serviceTimeEnd1, $lat, $lng, $storeNotice)
    {
        $data = array();
        $data['stationName'] = $stationName;
        $data['phone'] = $phone;
        $data['city'] = $city;
        $data['county'] = $county;
        $data['stationAddress'] = $stationAddress;
        $data['operator'] = $operator;
        $data['serviceTimeStart1'] = $serviceTimeStart1;
        $data['serviceTimeEnd1'] = $serviceTimeEnd1;
        $data['lat'] = $lat;
        $data['lng'] = $lng;
        $data['coordinateType'] = 3;
        $data['closeStatus'] = 0;
        $data['storeNotice'] = $storeNotice;

        return $data;
    }
    /** 
     * 发送新增无资质门店接口
     */
    public function sendCreateStore($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("createStore : " . json_encode($postData), "run", "channel_jddj");

        $res = $this->sendData('store/createStore', $postData);

        $this->DLOG("createStore_res : " . json_encode($res, JSON_UNESCAPED_UNICODE), "run", "channel_jddj");

        return $res['data'];
    }

    /** 修改门店信息接口
     * @param $stationNo 门店编号
     * @param $stationName 门店名称
     * @param $phone 门店电话
     * @param $city 城市编码
     * @param $county 镇/区编码
     * @param $stationAddress 门店地址
     * @param $operator 操作人
     * @param $serviceTimeStart1 营业时间1开始
     * @param $serviceTimeEnd1 营业时间1结束
     * @param $lat 门店纬度
     * @param $lng 门店经度
     * @param $coordinateType 使用的地图类型(1,谷歌), (2,百度), (3,高德), (4,腾讯)
     * @param $closeStatus 休息中状态，0正常营业1休息中
     * @param $storeNotice 门店公告
     */
    public function updateStoreInfo4Open($stationNo, $stationName, $phone, $city, $county, $stationAddress, $operator, $serviceTimeStart1, $serviceTimeEnd1, $lat, $lng, $coordinateType, $closeStatus, $storeNotice)
    {
        $data = array();
        $data['stationNo'] = $stationNo;
        $data['stationName'] = $stationName;
        $data['phone'] = $phone;
        $data['city'] = $city;
        $data['county'] = $county;
        $data['stationAddress'] = $stationAddress;
        $data['operator'] = $operator;
        $data['serviceTimeStart1'] = $serviceTimeStart1;
        $data['serviceTimeEnd1'] = $serviceTimeEnd1;
        $data['lat'] = $lat;
        $data['lng'] = $lng;
        $data['coordinateType'] = 3;
        $data['closeStatus'] = $closeStatus;
        $data['storeNotice'] = $storeNotice;

        return $data;
    }
    /** 
     * 发送修改门店信息接口
     */
    public function sendUpdateStoreInfo4Open($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("updateStoreInfo4Open : " . json_encode($postData), "run", "channel_jddj");

        $res = $this->sendData('store/updateStoreInfo4Open', $postData);

        $this->DLOG("updateStoreInfo4Open_res : " . json_encode($res, JSON_UNESCAPED_UNICODE), "run", "channel_jddj");

        return $res;
    }

    /** 
      * 获取所有城市信息列表接口
     */
    public function allcities()
    {
        $data = array();

        return $data;
    }
    /** 
     * 发送获取所有城市信息列表接口
     */
    public function sendAllcities($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("allcities : " . json_encode($postData), "run", "channel_jddj");

        $res = $this->sendData('address/allcities', $postData);

        $this->DLOG("allcities_res : " . json_encode($res, JSON_UNESCAPED_UNICODE), "run", "channel_jddj");

        return $res;
    }

    
}